+++ /dev/null
-<?php
-/**
- * Samogitian (Žemaitėška) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @author Niklas Laxström
- * @ingroup Language
- */
-
-/**
- * Samogitian (Žemaitėška)
- *
- * @ingroup Language
- */
-class LanguageSgs extends Language {
-
- /**
- * @param $count int
- * @param $forms array
- * @return string
- */
- function convertPlural( $count, $forms ) {
- if ( !count( $forms ) ) { return ''; }
- $forms = $this->preConvertPlural( $forms, 4 );
-
- $count = abs( $count );
- if ( $count == 0 || ( $count % 100 === 0 || ( $count % 100 >= 10 && $count % 100 < 20 ) ) ) {
- return $forms[2];
- } elseif ( $count % 10 === 1 ) {
- return $forms[0];
- } elseif ( $count % 10 === 2 ) {
- return $forms[1];
- } else {
- return $forms[3];
- }
- }
-}
<pluralRules locales="bho">
<pluralRule count="one">n in 0..1</pluralRule>
</pluralRules>
+ <pluralRules locales="sgs">
+ <pluralRule count="one">n mod 10 is 1 and n mod 100 is not 11</pluralRule>
+ <pluralRule count="two">n mod 10 is 2 and n mod 100 is not 12</pluralRule>
+ <pluralRule count="few">n is 0 or n mod 100 is 0 or n mod 100 in 10..19</pluralRule>
+ </pluralRules>
</plurals>
</supplementalData>
/** @dataProvider providePluralAllForms */
function testPluralAllForms( $result, $value ) {
- $forms = array( 'one', 'few', 'many', 'other' );
+ $forms = array( 'one', 'two', 'few', 'other' );
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
function providePluralAllForms() {
return array(
- array( 'many', 0 ),
+ array( 'few', 0 ),
array( 'one', 1 ),
- array( 'few', 2 ),
+ array( 'two', 2 ),
array( 'other', 3 ),
- array( 'many', 10 ),
- array( 'many', 11 ),
- array( 'many', 12 ),
- array( 'many', 19 ),
+ array( 'few', 10 ),
+ array( 'few', 11 ),
+ array( 'few', 12 ),
+ array( 'few', 19 ),
array( 'other', 20 ),
- array( 'many', 100 ),
+ array( 'few', 100 ),
array( 'one', 101 ),
- array( 'many', 111 ),
- array( 'many', 112 ),
+ array( 'few', 111 ),
+ array( 'few', 112 ),
);
}